package models

import (
	"my_gin_blog/dao"
	"time"
)

type BigQueryLogDetail struct {
	ID            uint `gorm:"primarykey"`
	SoNumberId    uint64
	SoNumber      string
	SoStatus      string
	LastUpdatedAt time.Time
	SendBqTime    time.Time
}

func GetCurrentMonthData(start int64, end int64) (BigQueryLogDetails []BigQueryLogDetail, err error) {
	err = dao.Db.Select("id,so_number_id,so_number,so_status").Where("send_bq_time BETWEEN ? and ?", start, end).Find(&BigQueryLogDetails).Error
	if err != nil {
		return nil, err
	}
	return BigQueryLogDetails, err
}
